#include "stuff.hpp"

cStuff::cStuff(int x, int y, cItemResources * resPointer)
{
    itemInfo = resPointer;
    pos = new sPoint(x, y);

    weapon = armor = helmet = boots = earrings = gloves = necklace = shield = pants = ring = -1;

    img = load_bmp("GFX\\char-stuff.bmp", default_palette);
}

cStuff::~cStuff()
{
    destroy_bitmap(img);
}

void cStuff::draw(BITMAP * bufor)
{
    blit(img, bufor, 0, 0, pos->x, pos->y, img->w, img->h);

    //rysowanie broni
    masked_blit(itemInfo->img, bufor, weapon * ITEM_SIZE, 0, pos->x + WEAPON_X, pos->y + WEAPON_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie zbroji
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + ARMOR_X, pos->y + ARMOR_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie spodni
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + PANTS_X, pos->y + PANTS_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie helmu
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + HELMET_X, pos->y + HELMET_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie tarczy
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + SHIELD_X, pos->y + SHIELD_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie naszyjnika
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + NECKLACE_X, pos->y + NECKLACE_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie kolczykow
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + EARRINGS_X, pos->y + EARRINGS_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie pierscienia
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + RING_X, pos->y + RING_Y, ITEM_SIZE, ITEM_SIZE);

    //rysowanie butow
    masked_blit(itemInfo->img, bufor, armor * ITEM_SIZE, 0, pos->x + BOOTS_X, pos->y + BOOTS_Y, ITEM_SIZE, ITEM_SIZE);
}
